package com.shopcart.service;

import java.util.Collection;
import java.util.Date;
import java.util.List;

import com.demo.mobile.MobException;
import com.h5.Ret;
import com.shopcart.domain.Order;
import com.shopcart.domain.OrderDetail;
import com.vsd.daoEx.model.OrderEx;
import com.zy.order.proto.MSOrder.MGoodsCartList;
import com.zy.order.proto.MSOrder.MOrderList;
import com.zy.sys.proto.MOCommon.MRet;
import com.zy.sys.proto.MOCommon.MRetEx;




public interface OrderService {
	int selectGoodsSellCnt(String goodsId,String start,String end);
	
	Order findById(String id);
	
	MRetEx.Builder postSingleOrder(MGoodsCartList.Builder carts,String userId) throws MobException;
	
	MRetEx.Builder postPadOrder(MGoodsCartList.Builder carts,String storeId) throws MobException;
	
	MRet.Builder toPay(Integer type,String id,String cashId,String userId) throws MobException,Exception;
	
	MOrderList.Builder selectMyOrderList(String userId,Integer state,Integer page,Integer limit) throws MobException;

	MRetEx.Builder postTgOrder(MGoodsCartList.Builder carts,String userId) throws MobException;

	Collection<OrderDetail> selectDetails(String orderId);

	void updateByPrimaryKey(Order order);

	int countByCreateTime(Date d);
	
	int countByCreateTimeAndAreaCode(String areaCode,Date d);
	
	int countByCreateTimeAndStoreId(String storeId,Date d);
	
	List<OrderEx> selectExList(String areaCode,String storeId,String storeName,String beginTime,String endTime,Integer type);
	
	int updateByPrimaryKeySelective(Order order);
	
	int storeAgreeBack(Order order,String storeId);

	Ret addDiancanOrder(String userId, Integer payType, String remark,
			String data, String couponId)throws Exception;

	String selectMyOrders(String userId, Integer page, Integer limit,
			Integer state);
	
}
